CREATE EXTERNAL TABLE jms_ods.yl_oms_oms_order_back(
  `id` bigint COMMENT '订单编号',                      
  `customer_order_id` string COMMENT '客户订单编号',     
  `order_source_code` string COMMENT '订单来源code',   
  `order_source_name` string COMMENT '订单来源名称',     
  `order_type_code` bigint COMMENT '订单类型code',     
  `waybill_id` string COMMENT '运单号',               
  `origin_id` bigint COMMENT '始发地id',              
  `origin_code` string COMMENT '始发地code',          
  `origin_name` string COMMENT '始发地名字',            
  `sender_name` string COMMENT '寄件人姓名',            
  `sender_company` string COMMENT '寄件人公司',         
  `sender_mobile_phone` string COMMENT '寄件人手机号',   
  `sender_telphone` string COMMENT '寄件人座机',        
  `sender_country_id` bigint COMMENT '寄件国家Id',     
  `sender_country_name` string COMMENT '寄件国家名称',   
  `sender_province_id` bigint COMMENT '寄件省份id',    
  `sender_province_name` string COMMENT '寄件省份名称',  
  `sender_city_id` bigint COMMENT '寄件城市id',        
  `sender_city_name` string COMMENT '寄件城市名��',     
  `sender_area_id` bigint COMMENT '寄件区域Id',        
  `sender_area_name` string COMMENT '寄件区域名称',      
  `sender_township` string COMMENT '寄件乡镇',         
  `sender_street` string COMMENT '寄件街道',           
  `sender_detailed_address` string COMMENT '寄件详细地址',  
  `sender_postal_code` string COMMENT '寄件邮编',      
  `sender_email` string COMMENT '',                
  `is_privacy` smallint COMMENT '隐私标记\; 1:是, 0:否',  
  `phone_contact` smallint COMMENT '电联标识\; 1:是, 0:否',  
  `receiver_name` string COMMENT '收件人姓名',          
  `receiver_company` string COMMENT '收件人公司',       
  `receiver_mobile_phone` string COMMENT '收件人手机号',  
  `receiver_telphone` string COMMENT '收件人座机',      
  `destination_id` bigint COMMENT '目的地id',         
  `destination_code` string COMMENT '目的地code',     
  `destination_name` string COMMENT '目的地名字',       
  `receiver_country_id` bigint COMMENT '收件国家id',   
  `receiver_country_name` string COMMENT '收件国家名称',  
  `receiver_province_id` bigint COMMENT '收件省份id',  
  `receiver_province_name` string COMMENT '收件省份名称',  
  `receiver_city_id` bigint COMMENT '收件城市id',      
  `receiver_city_name` string COMMENT '收件城市名称',    
  `receiver_area_id` bigint COMMENT '收件区域id',      
  `receiver_area_name` string COMMENT '收件区域名称',    
  `receiver_township` string COMMENT '收件乡镇',       
  `receiver_street` string COMMENT '收件街道',         
  `receiver_detailed_address` string COMMENT '收件详细地址',  
  `receiver_postal_code` string COMMENT '收件邮编',    
  `receiver_email` string COMMENT '',              
  `receiver_sorting_code` string COMMENT '收件分拣码',  
  `terminal_dispatch_code` string COMMENT '三段码',   
  `accurate` tinyint COMMENT '三段码是否保证准确, true:保证准确 false:不保证准确',  
  `remarks` string COMMENT '',                     
  `express_type_code` string COMMENT '快件类型code',   
  `express_type_name` string COMMENT '快件类型名称',     
  `insured` smallint COMMENT '需要保价1是，0否',          
  `declared_value` double COMMENT '货品声明价值',        
  `insured_value` double COMMENT '���价费',          
  `cod_need` smallint COMMENT '需要代收货款,1是，0否',      
  `cod_money` double COMMENT '代收货款金额',             
  `cod_fee` double COMMENT '代收货款手续费',              
  `cod_currency_type_code` string COMMENT '代收货款币别code',  
  `cod_currency_type_name` string COMMENT '代收货款币别名称',  
  `goods_type_code` string COMMENT '物品类型code',     
  `goods_type_name` string COMMENT '物品类型名称',       
  `goods_name` string COMMENT '物品名称',              
  `package_number` smallint COMMENT '件数,＞1表示子母件，如果业务上不支持子母件，则前端限制不显示，并默认为1',  
  `package_length` double COMMENT '包裹总长,单位厘米',     
  `package_wide` double COMMENT '包裹总宽,单位厘米',       
  `package_high` double COMMENT '包裹总高,单位厘米',       
  `packate_volume` double COMMENT '包裹体积重,单位立方厘米',  
  `package_charge_weight` double COMMENT '包裹计费重量,单位千克',  
  `package_total_weight` double COMMENT '包裹总重量,单位千克',  
  `box_standard_id` bigint COMMENT '箱子规格id',       
  `box_standard_code` string COMMENT '箱子规格code',   
  `box_standard_name` string COMMENT '箱子规格',       
  `box_price` double COMMENT '箱子价格',               
  `standard_value` double COMMENT '标准运费',          
  `receivable_freight` double COMMENT '应收运费',      
  `discount_freight` double COMMENT '折扣运费',        
  `total_freight` double COMMENT '总运费',            
  `payment_mode_code` string COMMENT '付款方式code',   
  `payment_mode_name` string COMMENT '付款方式名称',     
  `paid_mode_id` smallint COMMENT '支付方式id',        
  `paid_mode_code` string COMMENT '支付方式code',      
  `paid_mode_name` string COMMENT '支付方式名称',        
  `customer_code` string COMMENT '客户编号code',       
  `customer_name` string COMMENT '客户编号名称',         
  `spm_money_type` string COMMENT '结算货币类型',        
  `send_code` string COMMENT '寄件服务方式code',         
  `send_name` string COMMENT '寄件服务方式名称',           
  `dispatch_code` string COMMENT '派件服务方式code',     
  `dispatch_name` string COMMENT '派件服务方式名称',       
  `dispatch_number` string COMMENT '调度单号',         
  `customer_order_time` timestamp COMMENT '客户下单时间',  
  `input_time` timestamp COMMENT '订单录入时间',         
  `order_status_code` bigint COMMENT '订单状态code',   
  `cancel_reason` string COMMENT '取消订单原因',         
  `cancel_time` timestamp COMMENT '订单取消时间',        
  `pick_fail_time` timestamp COMMENT '取件失败时间',
  `pick_fail_reason` string COMMENT '取件失败原因',      
  `prints_number` smallint COMMENT '打印次数',         
  `best_pick_time_start` timestamp COMMENT '最佳取件开始时间',  
  `best_pick_time_end` timestamp COMMENT '最佳取件结束时间',  
  `real_pick_network_id` bigint COMMENT '实际取件网点id',  
  `real_pick_network_code` string COMMENT '实际取件网点code',  
  `real_pick_network_name` string COMMENT '实际取件网点名称',  
  `dispatch_network_time` timestamp COMMENT '调度网点时间',  
  `pick_network_id` bigint COMMENT '取件网点id',       
  `pick_network_code` string COMMENT '取件网点code',   
  `pick_network_name` string COMMENT '取件���点名称',   
  `dispatch_staff_time` timestamp COMMENT '调度业务员时间',  
  `pick_staff_code` string COMMENT '取件业务员code',    
  `pick_staff_name` string COMMENT '取件业务员名称',      
  `pick_time` timestamp COMMENT '取件时间',            
  `last_dispatch_network_id` bigint COMMENT '上一次调度网点id',  
  `fourth_segment_code` string COMMENT '上一次调度网点名称字段改名为四段码',  
  `receiver_encrypt_phone` string COMMENT '上一次调度网点code改为收件人加密手机号',  
  `last_dispatch_network_time` timestamp COMMENT '上一次调度网点时间',  
  `dispatch_network_reason` string COMMENT '调度网点原因',  
  `receiver_encrypt_telphone` string COMMENT '收件人加密座机号',  
  `last_dispatch_staff_name` string COMMENT '上一次调度业务员名称',  
  `last_dispatch_staff_time` timestamp COMMENT '上一次调度业务员时间',  
  `assigner_name` string COMMENT '委托人姓名',          
  `assigner_mobile_phone` string COMMENT '委托人手机号',  
  `goods_value` double COMMENT '物品价值',             
  `express_type_id` bigint COMMENT '快件类型id',       
  `goods_type_id` bigint COMMENT '物品类型id',         
  `payment_mode_id` bigint COMMENT '付款方式id',       
  `box_number` bigint COMMENT '箱子数量',              
  `member_id` bigint COMMENT '会员id',               
  `sender_country_code` string COMMENT '寄件国家三字码',  
  `receiver_country_code` string COMMENT '收件国家三字码',  
  `customer_id` bigint COMMENT '客户id',             
  `update_by` bigint COMMENT '最后更新人ID',            
  `update_by_name` string COMMENT '更新人姓名',         
  `update_time` timestamp COMMENT '更新时间',          
  `last_update_time_sync` timestamp COMMENT '同步ES更新时间',  
  `is_delete` smallint COMMENT '是否删除,1未删除，2已删除',   
  `is_plaintext` tinyint COMMENT '',               
  `create_by` bigint COMMENT '创建人ID',              
  `create_by_code` string COMMENT '创建人编码',         
  `create_by_name` string COMMENT '创建人姓名',         
  `back_dispatch_network_number` bigint COMMENT '打回调度订单次数',  
  `back_dispatch_network_reason` string COMMENT '打回调度订单原因',  
  `back_dispatch_network_time` timestamp COMMENT '打回调度订单时间',  
  `settlement_weight` double COMMENT '结算重量',       
  `dispatch_network_id` bigint COMMENT '派件网点id',   
  `cancel_reason_code` bigint COMMENT '订单取消原因编号',  
  `need_dispatch` bigint COMMENT '是否需要调度 1需要 2不需要',  
  `proxy_area_id` bigint COMMENT '代理区id',          
  `proxy_area_code` string COMMENT '代理区code',      
  `proxy_area_name` string COMMENT '代理区name',      
  `cancel_explain` string COMMENT '取消订单说明',        
  `dispatch_proxy_area_time` timestamp COMMENT '调度代理区时间',  
  `is_real_name` smallint COMMENT '是否实名制,1是，0否',   
  `real_name` string COMMENT '实名姓名',               
  `id_no_type` smallint COMMENT '证件类型',            
  `id_no` string COMMENT '证件号码',                   
  `sex` smallint COMMENT '性别',                     
  `exception_msg` string COMMENT '异常信息',           
  `subscribe_source_code` string COMMENT '订单订阅来源 code',  
  `package_volume` int COMMENT '包裹体积 单位立方厘米',      
  `customer_waybill_no` string COMMENT '客户运单号',    
  `is_business` tinyint COMMENT '是否是商务件 1是 2否',    
  `print_status_code` string COMMENT '云打印状态',      
  `second_code_hit_desc` string COMMENT '二段码命中原因',  
  `dispatch_network_code` string COMMENT '派件网点code',  
  `dispatch_network_name` string COMMENT '派件网点名称',  
  `is_can_cancel` bigint COMMENT '是否允许被极兔取消#1,不允许\;0,允许',  
  `sign_receipt` tinyint COMMENT '签回单 0:否 ，1:是，2:回单',  
  `subscribe_source_name` string COMMENT '订单订阅来源 name',  
  `last_center_code` string COMMENT '集包地编码',       
  `last_center_name` string COMMENT '集包地名称',       
  `receipt_freight` double COMMENT '回单金额',         
  `is_transfer` tinyint COMMENT '是否转寄(1否 2是)')     
COMMENT '订单表'                                      
PARTITIONED BY (                                   
  `dt` string COMMENT '时间分区')                      
ROW FORMAT SERDE                                   
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'  
STORED AS INPUTFORMAT                              
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'  
OUTPUTFORMAT                                       
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat' 
LOCATION                                           
  'hdfs://yl-bg-hdp/dw/hive/jms_ods.db/external/yl_oms_oms_order_back'